<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<a href="http://www.jd.com" target="_blank">京东</a>
		<a href="http://www.baidu.com" target="_blank">百度</a>
		<a class="tb" href="http://www.taobao.com" target="_blank">淘宝</a>
		<a name="tm" href="http://www.tmall.com" target="_blank">天猫</a>
		<a id="whh" href="http://www.wahaha.com.cn" target="_blank">娃哈哈</a>
		<a name="tm"href="http://www.elm.me" target="_blank">饿了么</a>
		<a id="zfb" href="http://www.alipay.com" target="_blank">支付宝</a>
	<script>
		// window.alert("中华人民共和国");
		// alert(document.getElementsByTagName('a')[5]);
		
		console.log(document.getElementById('whh').innerText);
		console.log(document.getElementById('whh').href);
		
		console.log(document.getElementsByName('tm')[1].innerText);
		console.log(document.getElementsByName('tm')[1].href)
		
		console.log(document.getElementsByClassName('tb')[0].innerText);
		console.log(document.getElementsByClassName('tb')[0].href);
		
		
		console.log(document.getElementsByTagName('a')[1].innerText);
		console.log(document.getElementsByTagName('a')[1].href);
		
		var a = document.getElementsByName('tm')[1];
		a.innerText='中国';
		a.href="http://www.alipay.com";
		
	</script>
	</body>
	
</html>
